// ml:run = $bin < input
#include <iostream>
#include <algorithm>
#include <cstring>

using ll = long long;

int const maxn = 1000007;
int const mo = 1000000007;
std::string s;
int n, m;
char p[maxn];
int a[maxn];
int next[maxn];
bool vis[maxn],vis1[maxn];

void getnext(std::string const& s, int len)
{
    next[0] = -1;
    for (int i = 0, j = -1; i < len; ) {
        if (j == -1 || s[i] == s[j]) {
            i++; j++;
            next[i] = j;
        } else
            j = next[j];
    }
    for (int r = len; r != -1; r = next[r]) vis1[r] = true;
}

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin >> n >> m >> s;
    int len = s.size();
    getnext(s, len);
    for (int i = 1; i <= m; i++) std::cin >> a[i];
    std::sort(a + 1, a + 1 + m);

    int flag = true;
    for (int i = 1; i <= m; i++) {
        if (i == 1 || a[i] - a[i - 1] >= len)
            for (int j = a[i]; j < a[i] + len; j++) vis[j]=1;
        else {
            if (vis1[a[i - 1] + len - a[i]]) {
                for(int j = a[i - 1] + len; j < a[i] + len; j++)
                    vis[j] = 1;
            } else { flag = false; break; }
        }
    }

    if (!flag) std::cout << "0\n";
    else {
        ll count = 1;
        for (int i = 1; i <= n; i++)
            if (!vis[i]) count = (count * 26) % mo;
        std::cout << count << "\n";
    }
}

